From a81cd3555482310df3bb7467e3fe0a9c50a62c0f Mon Sep 17 00:00:00 2001 From: "adsharma@los-vmm.sc.intel.com" Date: Mon, 22 Aug 2005 11:31:19 -0700 Subject: [PATCH] Implement cpu_physical_memory_reset_dirty() Signed-off-by: Don Dugger Signed-off-by: Arun Sharma --- tools/ioemu/cpu-all.h | 2 ++ tools/ioemu/exec.c | 10 ++++++++++ tools/ioemu/hw/vga.c | 3 +-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/ioemu/cpu-all.h b/tools/ioemu/cpu-all.h index 6e9a8b8ac5..7374c2e8a0 100644 --- a/tools/ioemu/cpu-all.h +++ b/tools/ioemu/cpu-all.h @@ -672,6 +672,8 @@ static inline void cpu_physical_memory_write(target_phys_addr_t addr, int cpu_memory_rw_debug(CPUState *env, target_ulong addr, uint8_t *buf, int len, int is_write); +#define VGA_DIRTY_FLAG 0x01 + /* read dirty bit (return 0 or 1) */ static inline int cpu_physical_memory_is_dirty(target_ulong addr) { diff --git a/tools/ioemu/exec.c b/tools/ioemu/exec.c index 102798e26a..286b3cd7f0 100644 --- a/tools/ioemu/exec.c +++ b/tools/ioemu/exec.c @@ -461,4 +461,14 @@ int cpu_memory_rw_debug(CPUState *env, target_ulong addr, void cpu_physical_memory_reset_dirty(target_ulong start, target_ulong end) { + uint8_t *p; + int len; + + if ((len = (end - start)) <= 0) + return; + p = phys_ram_dirty + (start >> TARGET_PAGE_BITS); + len = len >> TARGET_PAGE_BITS; + while (len > 0) + p[--len] &= ~VGA_DIRTY_FLAG; + return; } diff --git a/tools/ioemu/hw/vga.c b/tools/ioemu/hw/vga.c index 2867bd55d4..144ae741c6 100644 --- a/tools/ioemu/hw/vga.c +++ b/tools/ioemu/hw/vga.c @@ -1620,7 +1620,6 @@ static CPUWriteMemoryFunc *vga_mem_write[3] = { static void vga_save(QEMUFile *f, void *opaque) { VGAState *s = opaque; - int i; qemu_put_be32s(f, &s->latch); qemu_put_8s(f, &s->sr_index); @@ -1661,7 +1660,7 @@ static void vga_save(QEMUFile *f, void *opaque) static int vga_load(QEMUFile *f, void *opaque, int version_id) { VGAState *s = opaque; - int is_vbe, i; + int is_vbe; if (version_id != 1) return -EINVAL; -- 2.30.2